<template>
    <div>
        我是详情
        <!-- {{$route.params.id}}
        {{detailarr}} -->
        <div v-if="detailarr.length">
            <div v-for="(item,index) in detailarr" :key="index">
                <img :src="item.img" alt="">
            </div>
        </div>
    </div>
</template>

<script>
import axios from "../utils/axios"
export default {
    data(){
        return {
            detailarr:[]
        }
    },
    mounted(){
           axios.get("/list").then(res=>{
                console.log(res.data);
                this.detailarr = res.data.filter((item,index)=>{
                    return item.id == this.$route.params.id
                })
                
       })
    }
}
</script>

<style>

</style>